﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Include/Admin.master" AutoEventWireup="true"
    CodeFile="Manage.aspx.cs" Inherits="Admin_YQLJ_Manage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../../Style/Common/DatePage.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true" ID="ScriptManager1" />
    <div>
        <table cellspacing="1" class="editTable" cellpadding="0" style="width: 100%; padding-bottom: 5px;
            border: 1px; border-color: #66CCFF;">
            <tr>
                <td style="font-weight: bold; font-size: large; background-image: url('/images/管理员页面/title_bg1.jpg');
                    background-repeat: repeat-x; font-family: 仿宋;" class="style2">
                    <strong>友情链接管理</strong>
                </td>
            </tr>
            <tr>
                <td align="center">
                    关键字：
                    <asp:TextBox ID="txtSearchKey" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSerach" runat="server" Text="搜  索" OnClick="btnSerach_Click" />
                </td>
            </tr>
        </table>
        <table cellspacing="0" cellpadding="0" style="width: 100%; padding-bottom: 5px; border: 1px;
            border-color: #66CCFF; background-color: #ffffff">
            <tr>
                <td align="center">
                    <asp:ListView ID="lvYQLJ" runat="server" DataKeyNames="ID" OnItemCanceling="lvYQLJ_ItemCanceling"
                        OnItemDeleting="lvYQLJ_ItemDeleting" OnItemEditing="lvYQLJ_ItemEditing" OnItemUpdating="lvYQLJ_ItemUpdating"
                        OnItemCommand="lvYQLJ_ItemCommand" OnPagePropertiesChanged="lvYQLJ_PagePropertiesChanged">
                        <LayoutTemplate>
                            <table width="100%" class="editTable" cellspacing="1">
                                <tr>
                                    <th>
                                        链接标题
                                    </th>
                                    <th>
                                        图片
                                    </th>
                                    <th>
                                        链接地址
                                    </th>
                                    <th>
                                        操作
                                    </th>
                                </tr>
                                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                            </table>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%# Eval("Title")%>
                                </td>
                                <td>
                                    <img alt="" src="/Resource/YQLJ/<%#Eval("ImgURL")??"no_image.jpg"%>" width="77px"
                                        height="45px" />
                                </td>
                                <td>
                                    <%# Eval("Link")%>
                                </td>
                                <td>
                                    <asp:LinkButton ID="ltbnRank" CommandName="Up" runat="server" CommandArgument='<%#Eval("ID")%>'>置顶</asp:LinkButton>
                                    <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit" Text="修改"></asp:LinkButton>&nbsp;
                                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" OnClientClick="return confirm('你确定要删除该项?');"
                                        CommandName="Delete"></asp:LinkButton>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtEditTitle" runat="server" Text='<%#Eval("Title")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <asp:FileUpload ID="fuEditImg" runat="server" />
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEdiURL" runat="server" Text='<%#Eval("Link")%>'></asp:TextBox>
                                </td>
                                <td style="width: 130px">
                                    <asp:LinkButton ID="lbtnCancel" runat="server" Text="取消" CommandName="Cancel"></asp:LinkButton>&nbsp;
                                    <asp:LinkButton ID="lbtnUpdate" runat="server" Text="更新" CommandName="Update"></asp:LinkButton>
                                </td>
                            </tr>
                        </EditItemTemplate>
                        <EmptyDataTemplate>
                            没有数据
                        </EmptyDataTemplate>
                    </asp:ListView>
                    <div style="padding: 4px; text-align: center;">
                        <asp:DataPager ID="Pager" runat="server" PagedControlID="lvYQLJ" OnPreRender="Pager_PreRender"
                            PageSize="20">
                            <Fields>
                                <asp:NumericPagerField ButtonCount="10" CurrentPageLabelCssClass="CurrentPage" NumericButtonCssClass="Page" />
                                <asp:NextPreviousPagerField ShowLastPageButton="true" ShowPreviousPageButton="true"
                                    ShowFirstPageButton="true" />
                                <asp:TemplatePagerField>
                                    <PagerTemplate>
                                        共<%=Pager.TotalRowCount%>条
                                    </PagerTemplate>
                                </asp:TemplatePagerField>
                            </Fields>
                        </asp:DataPager>
                    </div>
                </td>
            </tr>
        </table>
        <asp:HyperLink ID="lnkAdd" runat="server" Text="添加友情链接" ForeColor="Blue"></asp:HyperLink>
        <asp:Panel ID="pnlAddYQLJ" runat="server" CssClass="addPnl">
            <h2>
                添加友情链接
            </h2>
            <p>
                请完成下面的内容:
            </p>
            <table cellspacing="1">
                <tr>
                    <th>
                        <span class="red">*</span>友情链接标题
                    </th>
                    <td>
                        <asp:TextBox ID="txtAddName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvAddName" runat="server" Display="Static" ErrorMessage="请输入导航标题"
                            ControlToValidate="txtAddName" ValidationGroup="ClientAddGroup"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span class="red">*</span>URL
                    </th>
                    <td>
                        <asp:TextBox ID="txtAddURL" runat="server" TextMode="MultiLine"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvAddURL" runat="server" Display="Static" ErrorMessage="请输入导航URL"
                            ControlToValidate="txtAddURL" ValidationGroup="ClientAddGroup"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <th>
                        上传图片
                    </th>
                    <td>
                        <asp:FileUpload ID="fulImg" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" Text="提交" ValidationGroup="ClientAddGroup"
                            OnClick="btnSubmit_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <ajaxToolkit:PopupControlExtender ID="PopUpExtender" runat="server" TargetControlID="lnkAdd"
            PopupControlID="pnlAddYQLJ" Position="Bottom">
        </ajaxToolkit:PopupControlExtender>
    </div>
</asp:Content>
